<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{main::head}">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="container-fluid">
    <form class="row justify-content-center" action="class-student-pageful">
        <div class="col-5">
            <label class="visually-hidden">按班级查找学生：</label>
            <input type="text" class="form-control" name="code" placeholder="输入班级代码查找">
        </div>
        <div class="col-auto">
            <button type="submit" class="btn btn-primary mb-3">查找</button>
        </div>
    </form>

    <table class="table">
        <thead>
        <tr>
            <th>
                ID
            </th>
            <th>
                姓名
            </th>
            <th>
                性别
            </th>
            <th>
                联系方式
            </th>
            <th>
                所属班级
            </th>
            <th>
                操作
            </th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="s,st:${pageBean?.arrayList}">
            <td th:text="${s.id_student}">
                1
            </td>
            <td th:text="${s.name}">
                TB - Monthly
            </td>
            <td th:text="${s.sex}">
                男
            </td>
            <td th:text="${s.phone}">
                119
            </td>
            <td th:text="${classes.class_name}">
                软件工程Java一班
            </td>
            <td>
                <a th:href="@{class-student/${classes.class_number}/${s.id_student}}">
                    移出此班
                </a>
                <script th:if="${boolean}">
                    window.alert("已移除")
                </script>
            </td>
        </tr>
        </tbody>
    </table>
    <nav>
        <ul class="pagination justify-content-end">
            <li class="page-item disabled" th:class="${pageBean?.current} == 1? 'page-item disabled':'page-item'">
                <a class="page-link" href="#"
                   th:href="@{class-student-pageful/15/${classes.class_number}(index=${pageBean?.current}-1)}"
                   tabindex="-1"
                   aria-disabled="true">上一页</a>
            </li>

            <li class="page-item" th:each="index:${#numbers.sequence(1,pageBean.totalPage)}">
                <a class="page-link" href="#"
                   th:href="@{class-student-pageful/15/${classes.class_number}(index=${pageBean.current}-1)}"
                   th:text="${index}">1</a>
            </li>
            <!--/*-->
            <li class="page-item"><a class="page-link" href="#">2</a></li>
            <li class="page-item"><a class="page-link" href="#">3</a></li>
            <!--*/-->
            <li class="page-item"
                th:class="(${pageBean.current} eq ${pageBean.totalPage})?'page-item disabled':'page-item'">
                <a class="page-link" href="#"
                   th:href="@{class-student-pageful/15/${classes.class_number}(index=${pageBean.current}+1)}">下一页</a>
            </li>
        </ul>
    </nav>
</div>

</body>
</html>